package com.example.lxj.LegalCase.service.impl;

import java.util.List;

import cn.hutool.core.date.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.example.lxj.LegalCase.mapper.TbCaseRegistrationMapper;
import com.example.lxj.LegalCase.entity.TbCaseRegistration;
import com.example.lxj.LegalCase.service.ITbCaseRegistrationService;

/**
 * 案件登记Service业务层处理
 * 
 * @author lxj
 * @date 2024-10-23
 */
@Service
public class TbCaseRegistrationServiceImpl implements ITbCaseRegistrationService 
{
    @Autowired
    private TbCaseRegistrationMapper tbCaseRegistrationMapper;

    /**
     * 查询案件登记
     * 
     * @param id 案件登记主键
     * @return 案件登记
     */
    @Override
    public TbCaseRegistration selectTbCaseRegistrationById(Long id)
    {
        return tbCaseRegistrationMapper.selectTbCaseRegistrationById(id);
    }

    /**
     * 查询案件登记列表
     * 
     * @param tbCaseRegistration 案件登记
     * @return 案件登记
     */
    @Override
    public List<TbCaseRegistration> selectTbCaseRegistrationList(TbCaseRegistration tbCaseRegistration)
    {
        return tbCaseRegistrationMapper.selectTbCaseRegistrationList(tbCaseRegistration);
    }

    /**
     * 新增案件登记
     * 
     * @param tbCaseRegistration 案件登记
     * @return 结果
     */
    @Override
    public int insertTbCaseRegistration(TbCaseRegistration tbCaseRegistration)
    {
        tbCaseRegistration.setCreateTime(DateUtil.date());
        return tbCaseRegistrationMapper.insertTbCaseRegistration(tbCaseRegistration);
    }

    /**
     * 修改案件登记
     * 
     * @param tbCaseRegistration 案件登记
     * @return 结果
     */
    @Override
    public int updateTbCaseRegistration(TbCaseRegistration tbCaseRegistration)
    {
        tbCaseRegistration.setUpdateTime(DateUtil.date());
        return tbCaseRegistrationMapper.updateTbCaseRegistration(tbCaseRegistration);
    }

    /**
     * 批量删除案件登记
     * 
     * @param ids 需要删除的案件登记主键
     * @return 结果
     */
    @Override
    public int deleteTbCaseRegistrationByIds(Long[] ids)
    {
        return tbCaseRegistrationMapper.deleteTbCaseRegistrationByIds(ids);
    }

    /**
     * 删除案件登记信息
     * 
     * @param id 案件登记主键
     * @return 结果
     */
    @Override
    public int deleteTbCaseRegistrationById(Long id)
    {
        return tbCaseRegistrationMapper.deleteTbCaseRegistrationById(id);
    }
}
